#include <iostream>
using namespace ::std;

int main() {
  string s;
  cin >> s;
  cout << s << endl;
  string result;
  for (auto c : s)
    if (!ispunct(c)) result += c;
  cout << result << endl;
  return 0;
}